package com.eatme.web.app.coupon.distribution.feign;

import com.eatme.web.app.coupon.common.vo.CouponTemplateSDK;
import com.eatme.web.common.vo.AppResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 优惠券模板Feign 接口定义
 */
@FeignClient(value = "web-case",contextId = "TemplateClient")
public interface TemplateClient {


    /**
     * 查找所有可用的优惠券模板
     * */
    @RequestMapping(value = "/template/sdk/all",
            method = RequestMethod.GET)
    AppResponse<List<CouponTemplateSDK>> findAllUsableTemplate();

    /**
     * <h2>获取模板 ids 到 CouponTemplateSDK 的映射</h2>
     * */
    @RequestMapping(value = "/template/sdk/infos",
            method = RequestMethod.GET)
    AppResponse<Map<Integer, CouponTemplateSDK>> findIds2TemplateSDK(
            @RequestParam("ids") Collection<Integer> ids
    );

}
